package com.example.yuanboot.common.msg;

/**
 * 普通响应类
 *
 * @author qingyan 2021-06-08
 */
public class ObjectRestResponse<T> extends BaseResponse{

    T data;

    public <T> ObjectRestResponse<T> data(Object data) {
        this.setData(data);
        return (ObjectRestResponse<T>) this;
    }

    public T getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = (T)data;
    }

    public static <T> ObjectRestResponse<T> ok(T data) {
        return new ObjectRestResponse<T>().data(data);
    }

    public static <T> ObjectRestResponse<T> ok() {
        return new ObjectRestResponse<>();
    }
}
